home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-03-19 | 3.6 KB | 119 lines | [TEXT/MPS ] |
- #########################################################################
- #########################################################################
- ## Copyright © Apple Computer, Inc. 1994-1997
- ## All rights reserved
- #########################################################################
- #########################################################################
- #
- # Library: LQAssist.vu
- #
- # Version: 2.1.4
- # Description: This Virtual User script is useful to LaunchQuit test
- # case developers and to those making changes to the
- # Launchquit engine itself. If this script is running,
- # the LaunchQuit Script will store its Target information
- # by sending a message to LQAssist. The next time
- # the LaunchQuit Script is executed, it tries to restore
- # its target information by asking LQAssist for the
- # stored list. This cuts the time to gather target
- # information from a minute to a few seconds!
- #
- # It is important to keep in mind that LQAssist must not
- # be used when running tests on real projects, since the
- # Target's settings may vary and LQAssist does not update
- # such changes. Use LQAssist only for development, then
- # stop LQAssist before starting your "real" run.
- #
- #
- # LQAssist setup:
- # 1. Set your Host and Target environment as usual.
- # Make sure the AEPost external tool exists on
- # the Host.
- # 2. Create a new User (row) with the Target and
- # LaunchQuit Script selected, just like normal.
- # 2. Create another new User (row) with no Target and
- # LQAssist.vu as the script.
- # 4. Run the virtual user for LQAssist.vu
- # 5. When the string:'LQAssist: waiting for msg: { }'
- # is displayed on LQAssist's notebook you are ready.
- # 6. Run your Target's script as many times as you like
- # and enjoy the time saved.
- #
- # In the future, it may do other things...
- #
- # NOTE: This feature requires the AEPost external tool.
- #
- # Contains:
- # script LQAssist()
- #
- # History:
- # Date: By: Changes:
- # 08/01/95 SBR Created
- # 08/13/95 SBR Added to LQ Project
- # 09/27/96 BRL Added SPEC Exception handling
- # 01/21/97 SBR Updated header.
- #########################################################################
- #########################################################################
- Libraries
- "AEPost.vuLib",
- "ExceptionHandling.lib";
-
- script LQAssist ( )
- begin
- ActorName("LQAssist");
- tStoredTargetInfo := {};
- InitMessages();
-
- while true
- begin
- tMsg := {};
- println "LQAssist: waiting for msg: {tMsg}";
-
- tMsg := ReceiveMessage( {'LQAssist'}, {}, false, true, 30000 );
- # tMsg := { 0, { {'tLQScriptID'}, g_Target_Info_ } }
- # or, tMsg := { 0, { {'tLQScriptID'}, {'restore'} } }
-
- if tMsg[1]
- begin
- println "LQAssist: error receiving msg: {tMsg}";
-
- if tMsg[1] <> -7 # Simple timeout
- begin
- global __gAEPostPresent := undefined;
- InitMessages();
- end;
-
- tMsg := {};
- end;
- else
- begin
- tMsg := tMsg[2];
- end;
-
- if tMsg
- begin
- tLQScriptID := tMsg[1];
- if tMsg[2] = { 'restore' }
- begin
- SendMessage( tLQScriptID, {'LQAssist'}, tStoredTargetInfo, false, 30000 );
- end;
- else
- begin
- tStoredTargetInfo := tMsg[2];
-
- println "LQAssist: FRESH NEW TARGET INFO at {_Match([time])}!!";
-
- tMsg := {};
- end;
- end;
- end;
- end;
-
-
- # AEPost primitives:
- # ReceiveMessage( pReceiverID, pSenderID, pReceiveMultiple, pDeleteMailbox := true,
- # pWaitForMessage := 0 )
- #
- # SendMessage( pReceiverID, pSenderID, pMessage, pCreateReplyMailbox := false,
- # pWaitForSend := 0, pWaitForReceipt := 0, pWaitForReply := 0 );
-